package com.lianxi;

import java.util.*;

public class ShangTest {
    public static void main(String[] args) {
        Shang shang = new Shang("大宝", 001, 10);
        Shang shang1 = new Shang("青蛙王子", 002, 8);
        Shang shang2 = new Shang("洗面奶", 003, 30);
        Set set = new HashSet();
        List list = new ArrayList();
        set.add(shang);
        set.add(shang1);
        set.add(shang2);
        Iterator iterator = set.iterator();
        while (iterator.hasNext()) {
            list.add(iterator.next());
        }

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }
}
